package com.example.springboot.demo.controller;

import org.springframework.web.bind.annotation.*;

@RequestMapping("/hello")
@RestController
public class HelloController {
    //既支持GET请求，也支持POST请求
    @RequestMapping("/m1")
    public String m1() {
        return "Hello, World!";
    }
    //支持GET请求
    @RequestMapping(value = "/m2", method = RequestMethod.GET)
    public String m2() {
        return "Hello, World!";
    }
    //支持POST请求
    @RequestMapping(value = "/m3", method = RequestMethod.POST)
    public String m3() {
        return "Hello, World!";
    }
    //支持GET
    @GetMapping("/m4")
    public String m4() {
        return "Hello, World!";
    }
    //支持POST
    @PostMapping("/m5")
    public String m5() {
        return "Hello, World!";
    }
}
